<!--
+----------------------------------------------------------------------
| 友得云客  - 开启房产营销新纪元
+----------------------------------------------------------------------
| Copyright (c) 2019~2023 优得（西安）信息科技有限公司版权所有
+----------------------------------------------------------------------
| Licensed 友得云客不是自由软件 未经允许不可移除相关版权
+----------------------------------------------------------------------
| Author: www.youdeyunke.com
+----------------------------------------------------------------------
-->
<template>
    <div style="margin: 0 auto 20px auto; width: 100%; padding: 0 16px" v-show="module && module.title">
        <style0 :fontcolor="fontcolor" :fontsize="fontsize" :link="link" :title="title" :icon="icon" :subtitle="subtitle" :theme-color="themeColor"
            v-if="styleName === 0"></style0>
        <style1 :fontcolor="fontcolor" :fontsize="fontsize" :link="link" :title="title" :subtitle="subtitle" :theme-color="themeColor" v-else-if="styleName === 1">
        </style1>
        <style2 :fontcolor="fontcolor" :fontsize="fontsize" :link="link" :title="title" :subtitle="subtitle" :theme-color="themeColor" v-else-if="styleName === 2">
        </style2>
        <style3 :fontcolor="fontcolor" :fontsize="fontsize" :link="link" :title="title" :subtitle="subtitle" :theme-color="themeColor" v-else-if="styleName === 3">
        </style3>
    </div>
</template>

<script>
import Style0 from "./Style0";
import Style1 from "./Style1";
import Style2 from "./Style2";
import Style3 from "./Style3";
export default {
    components: { Style0, Style1, Style2, Style3 },
    data () {
        return {
            loading: false,
        };
    },
    props: {
        module: { type: Object },
    },

    mounted: function () { },

    computed: {
        styleName: function () {
            return this.module.styleName || 0;
        },
        title: function () {
            return this.module.title.text;
        },
        icon: function () {
            return this.module.title.icon
        },
        fontsize: function () {
            var fs=this.module.title.fontSize
            if(!fs){
                fs = 40
            }
            fs = fs > 40 ? 40 : fs
            fs = fs < 20 ? 20 : fs
            fs = parseInt(fs)
            return fs
        },
        fontcolor: function () {
            return this.module.title.color || '#000000';
        },
        themeColor: function () {
            return this.$store.state.myconfig.color.primary || '#1989fa'

        },
        subtitle: function () {
            return this.module.subtitle.text;
        },
        link: function () {
            return this.module.link;
        },
    },

    methods: {},
};
</script>

<style lang="scss" scoped></style>
